/**
 * 继承：es5的实现方式
 * 组合寄生继承
*/
// function Person(name, age){
//     this.age = age
//     this.name = name
// }
// Person.prototype.say = function(){
//     console.log('我是es5---Person')
// }

// function SuperPerson(name, age, power){
//     Person.call(this, name, age, power)
//     this.power = power;
// }
// SuperPerson.prototype = Object.create(Person.prototype);
// SuperPerson.prototype.constructor = SuperPerson;

// SuperPerson.prototype.fly = function (height) {
//     console.log('我是es5---SuperPerson');
// }

// let obj = new SuperPerson( '张三', 18, 'strong' );
// console.log(obj,'obj')

/**
 * 
*/
function Teacher (name, age) {
    
}
/**
 * 
*/
function Student (name, age) {
    
}


class Person{
    constructor(name, age){
        this.name = name;
        this.age = age;
    }
    say(o = 'say'){
        console.log(o)
    }
}
class SuperMan extends Person{
    constructor(name, age, strong){
        super(name, age);
        this.strong = strong;
    }
    fly(height){
        console.log('fly')
    }
}